<!--
 * @Author: Dee Dee
 * @Date: 2023-08-14 14:45:18
 * @LastEditors: Dee Dee
 * @LastEditTime: 2023-08-16 17:01:56
 * @FilePath: /培训认证系统20230814/src/views/vadmin/home/components/partOne/left.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->

<template>
    <el-card class="admin_main">
        <el-row>
            <el-col :span="4">
                <el-statistic group-separator="," :precision="0" :value="parseInt(form.Exam.count)"
                    title="考试场数"/>
            </el-col>
            <el-col :span="4">
                <el-statistic group-separator="," :precision="0" :value="parseInt(form.TrainTask.count)"
                    title="培训场数"/>
            </el-col>
            <el-col :span="4">
                <el-statistic group-separator="," :precision="0" :value="parseInt(form.Question.count)"
                    title="试题总数"/>
            </el-col>
            <el-col :span="4">
                <el-statistic group-separator="," :precision="0" :value="parseInt(form.Course.count)"
                    title="课程总数"/>
            </el-col>

            <el-col :span="4">
                <el-statistic group-separator="," :precision="0" :value="parseInt(form.Knowledge.count)"
                    title="知识点总数"/>
            </el-col>
            <el-col :span="4">
                <el-statistic group-separator="," :precision="0" :value="parseInt(form.Certificate.count)"
                    title="发证数量"/>
            </el-col>

        </el-row>
    </el-card>
</template>

<script>
import { mapGetters, mapState } from "vuex";
import variables from "@/assets/styles/variables.scss";
import { getStatistics } from '@/api/vadmin/home/index'
export default {
    name: "partMain",
    data() {
        return {
            // 遮罩层
            loading: true,
            form: { 
                Exam: { count: null }, 
                Question: { count: null }, 
                TrainTask: { count: null }, 
                Knowledge: { count: null }, 
                Course: { count: null }, 
                Certificate: { count: null } },

        };
    },

    computed: {
        ...mapState(["settings"]),
        variables() {
            return variables;
        },
        theme() {
            return this.$store.state.settings.theme;
        },
    },

    mounted() { },
    created() {
        this.getList();
    },
    methods: {
        /** 查询列表 */
        getList() {
            this.loading = true;
            getStatistics().then(res => {
                console.log(222, res)
                this.form = res
            })
        },

    },
};
</script>

<style lang="scss" scoped>
.admin_main {
    margin: 0 10px;
    background: rgb(255, 173, 69);
}

/deep/.head {
    font-weight: bold !important;
    font-size: 17px; // color:#ffe1bae6;
    color: #fff;
    margin-bottom: 8px;
}

/deep/ .con {
    color: #ffeace;
    font-weight: bold !important;
    font-size: 28px;
}
</style>
  